#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read() {
    int f=0,t=0;
    char c=getchar();
    while(!isdigit(c)) t|=(c=='-'),c=getchar();
    while(isdigit(c)) f=(f<<3)+(f<<1)+c-48,c=getchar();
    return t?-f:f;
}
void write(int x) {
    if(x<0) putchar('-'),x=-x;
    if(x>9) write(x/10);
    putchar('0'+x%10);
}
int a[200005];
signed main(){
	freopen("pockets.in","r",stdin);
	freopen("pockets.out","w",stdout);
	int n=read(),sum=0;
	for(int i=1;i<n;i++){cin>>a[i];if(i>2) sum+=a[i];}
	int m;
	cin>>m;
	while(m--){
		int p;
		cin>>p;a[n]=p;
		if(n==3){cout<<a[1]+a[n]-a[2]<<'\n';}
		else{
			if(n==4)cout<<max(a[1]+a[3]-a[2]-a[n],a[1]+a[n]-a[2])<<'\n';
			else cout<<a[1]+a[n]-a[2]-sum<<'\n';
		}
	}
	return 0;
}
